
import AbsMenu from '../absmenu.js'

class UserMenu extends AbsMenu.AbsMenu  {
    constructor(map,item) {
        super(map,item);
    }

    act2Click()  {
        console.log("UserMenu-----+"+this.menuSubItem);
        switch(this.menuSubItem){
            case 'login':
                this.login();
                break;

            case 'myShare':
                break;

            case 'reg':
                this.regUser();
                break;
            case 'patternclass':
                this.patternClass();
                break;

        }
        
    }

    login() {
        let t = window.refLoginDlg.value;
        if (t && !t.visible) {
            t.visible = true;
        }
    }

    regUser(){
        let t = window.refUserRegDlg.value;
        if (t && !t.visible) {
            t.visible = true;
        }
    }

    patternClass(){
        let t = window.refPatternClassDlg.value;
        console.log(t);
        t.initAllCategory();
        if (t && !t.drawerVisible) {
            t.drawerVisible = true;
        }
    }
}

export default { UserMenu }

